//
//  GGLoginViewController.m
//  DDLock
//
//  Created by ios on 2017/12/25.
//  Copyright © 2017年 saiyi. All rights reserved.
//

#import "GGLoginViewController.h"
#import "GGRetrievePwdViewController.h"
#import "GGRegisterViewController.h"

@interface GGLoginViewController ()<UITextFieldDelegate>

@property (weak, nonatomic) IBOutlet UIView *loginBackView;
@property (weak, nonatomic) IBOutlet UITextField *phoneTextField;
@property (weak, nonatomic) IBOutlet UITextField *pwdTextField;
@property (weak, nonatomic) IBOutlet UIButton *loginBtn;
@property (weak, nonatomic) IBOutlet NSLayoutConstraint *phoneTop;
@property (weak, nonatomic) IBOutlet NSLayoutConstraint *pwdTop;
@property (weak, nonatomic) IBOutlet NSLayoutConstraint *pwdBottom;
@property (weak, nonatomic) IBOutlet NSLayoutConstraint *loginTop;

@end

@implementation GGLoginViewController

- (void)setDidLoad {
    
    [self _setInitialize];
    
}

#pragma mark - private
// 初始化
- (void)_setInitialize {
    
    self.phoneTextField.delegate = self;
    self.pwdTextField.delegate = self;
    
    self.loginBackView.layer.cornerRadius = 10.0f;
    self.loginBackView.layer.shadowColor = [UIColor blackColor].CGColor;
    self.loginBackView.layer.shadowOpacity = 0.2;
    self.loginBackView.layer.shadowOffset = CGSizeMake(3, 3);
    self.loginBackView.layer.shadowRadius = 10;
    
    self.loginBtn.layer.cornerRadius = 5.0f;
    self.loginBtn.layer.masksToBounds = YES;
    
}

- (void)touchesBegan:(NSSet<UITouch *> *)touches withEvent:(UIEvent *)event {
    [self.view endEditing:YES];
}

- (void)setWillAppear {
    [super setWillAppear];
   
}

#pragma mark - UITextFieldDelegate



// 忘记密码
- (IBAction)forgetBtn:(UIButton *)sender {
    
    GGRetrievePwdViewController *pwdVC = [[GGRetrievePwdViewController alloc] init];
    pwdVC.title = @"忘记密码";
    [self.navigationController pushViewController:pwdVC animated:YES];
}
// 立即注册
- (IBAction)registerBtn:(UIButton *)sender {
    
    GGRegisterViewController *registerVC = [[GGRegisterViewController alloc] init];
    registerVC.title = @"注册";
    [self.navigationController pushViewController:registerVC animated:YES];
    
}
// 登录
- (IBAction)clickLoginBtn:(UIButton *)sender {
    
}

@end
